/*
 * Copyright (c) 2010-2011, Yawning <yawninglol at gmail.com>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   * Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *
 *   * Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 *
 *   * Neither the name of the Mew Developers nor the
 *     names of its contributors may be used to endorse or promote products
 *     derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 * THE POSSIBILITY OF SUCH DAMAGE.
 */

package yawning.mew.bear;

import yawning.mew.character.StatLogic;

public class BearStatLogic {
	// XXX: Eventually move the hardcoded values to statlogic.xml

	// Sources:
	// https://spreadsheets.google.com/ccc?key=0Ann4EqTXSSPwdFlISWZucm1DU252eXFsUm9NeDNMT1E&hl=en#gid=0 (Swipe)
	// http://elitistjerks.com/f73/t110357-feral_bear_theorycraft_rawr_bear/ (Feral FF)
	// All threat values pre-stance multiplier.

	// Feral FF
	// Damage: FeralFFBaseDmg + AP * FeralFFCoeff
	// Threat: Damage + FeralFFFAThreat * nrFeralAggression
	// Note: Bonus threat is gone in 4.1 PTR (Not sure about FA threat).
	private int FeralFFBaseDmg;
	private double FeralFFCoeff;
	private int FeralFFFAThreat;

	// Mangle
	// Damage: WeaponDmg * MangleMult + MangleDmg
	private double MangleMult;
	private int MangleDmg;

	// Maul
	// Damage: MaulBaseDmg + AP * MaulCoeff
	// Threat: Damage + MaulBonusThreat
	private int MaulBaseDmg;
	private double MaulCoeff;
	private int MaulBonusThreat;

	// Swipe
	// Damage : SwipeBaseDmg + AP * SwipeCoeff
	private int SwipeBaseDmg;
	private double SwipeCoeff;

	// Thrash
	// Damage : ThrashDmg + AP * ThrashDmgCoeff, ThrashDoTDmg + AP * ThrashDoTCoeff
	private int ThrashDmg;
	private double ThrashDmgCoeff;
	private int ThrashDoTDmg;
	private double ThrashDotCoeff;

	// Lacerate
	// Damage : LacerateDmg + AP * LacerateDmgCoeff, LacerateDoTDmg + AP * LacerateDoTCoeff (Per Stack)
	private int LacerateDmg;
	private double LacerateDmgCoeff;
	private int LacerateDoTDmg;
	private double LacerateDotCoeff;

	// Pulverise
	// Damage : WeaponDmg * PulverizeMult + PulverizeDmg * LacerateStacks
	private double PulverizeMult;
	private int PulverizeDmg;

	public BearStatLogic(StatLogic sl) {
		this.FeralFFCoeff = 0.108;
		this.MangleMult = 1.9;
		this.MaulCoeff = 0.19;
		this.SwipeCoeff = 0.123;
		this.ThrashDmgCoeff = 0.0982;
		this.ThrashDotCoeff = 0.0167;
		this.LacerateDmgCoeff = 0.0552;
		this.LacerateDotCoeff = 0.00369;
		this.PulverizeMult = 0.6;

		// Pull values out of statlogic.xml.
		this.MangleDmg = sl.mStats.get("mangleBearDamage").intValue();
		this.FeralFFBaseDmg = sl.mStats.get("feralFFBaseDamage").intValue();
		this.FeralFFFAThreat = sl.mStats.get("feralFFFAThreat").intValue();
		this.MaulBaseDmg = sl.mStats.get("maulBaseDamage").intValue();
		this.MaulBonusThreat = sl.mStats.get("maulBonusThreat").intValue();
		this.SwipeBaseDmg = sl.mStats.get("swipeBearBaseDamage").intValue();
		this.ThrashDmg = sl.mStats.get("thrashDamage").intValue();
		this.ThrashDoTDmg = sl.mStats.get("thrashDotDamage").intValue();
		this.LacerateDmg = sl.mStats.get("lacerateDamage").intValue();
		this.LacerateDoTDmg = sl.mStats.get("lacerateDotDamage").intValue();
		this.PulverizeDmg = sl.mStats.get("pulverizeDamage").intValue();
	}

	public final int getFeralFFBaseDmg() { return FeralFFBaseDmg; }
	public final double getFeralFFCoeff() { return FeralFFCoeff; }
	public final int getFeralFFFAThreat() { return FeralFFFAThreat; }

	public final double getMangleMult() { return MangleMult; }
	public final int getMangleDmg() { return MangleDmg; }

	public final int getMaulBaseDmg() { return MaulBaseDmg; }
	public final double getMaulCoeff() { return MaulCoeff; }
	public final int getMaulBonusThreat() { return MaulBonusThreat; }

	public final int getSwipeBaseDmg() { return SwipeBaseDmg; }
	public final double getSwipeCoeff() { return SwipeCoeff; }

	public final int getThrashDmg() { return ThrashDmg; }
	public final double getThrashDmgCoeff() { return ThrashDmgCoeff; }
	public final int getThrashDoTDmg() { return ThrashDoTDmg; }
	public final double getThrashDoTCoeff() { return ThrashDotCoeff; }

	public final int getLacerateDmg() { return LacerateDmg; }
	public final double getLacerateDmgCoeff() { return LacerateDmgCoeff; }
	public final int getLacerateDoTDmg() { return LacerateDoTDmg; }
	public final double getLacerateDoTCoeff() { return LacerateDotCoeff; }

	public final double getPulverizeMult() { return PulverizeMult; }
	public final int getPulverizeDmg() { return PulverizeDmg; }
}
